import axios from "@/http/http.js";
// 封装获取药品信息接口
export const medicationFindAPI = (data) => {
    return axios({
        url: '/medication/find',
        method: 'post',
        data
    })
};

// 封装添加药品信息接口
export const medicationAddAPI = (data) => {
    return axios({
        url: '/medication/add',
        method: 'post',
        data
    })
};

// 封装删除药品信息接口
export const medicationDeleteAPI = (data) => {
    return axios({
        url: '/medication/delete',
        method: 'put',
        data,
        headers: { "content-type": "application/x-www-form-urlencoded" }
    })
};

// 封装修改药品信息接口
export const medicationUpdateAPI = (data) => {
    return axios({
        url: '/medication/update',
        method: 'put',
        data
    })
};

// 封装获取已有药品下拉框接口
export const medicationDropDownFindAPI = (institutionId) => {
    return axios({
        url: `/medication/findMedicationDropDown/${institutionId}`,
        method: 'post',
        institutionId
    })
};

// 封装获取未有药品下拉框接口
export const medicationDropDownWithoutFindAPI = (institutionId) => {
    return axios({
        url: `/medication/findMedicationDropDownWithout/${institutionId}`,
        method: 'post',
        institutionId
    })
};